﻿namespace NUnit.Framework
{
    public static class StringAssertions
    {
        public static void ShouldStartWith(this string actual, string expected)
        {
            StringAssert.StartsWith(expected, actual);
        }

        public static void ShouldEndWith(this string actual, string expected)
        {
            StringAssert.EndsWith(expected, actual);
        }

        public static void ShouldMatch(this string actual, string pattern)
        {
            Assert.That(actual, Text.Matches(pattern));
        }

        public static void ShouldNotMatch(this string actual, string pattern)
        {
            Assert.That(actual, Text.DoesNotMatch(pattern));
        }

        public static void ShouldContain(this string actual, string expected)
        {
            StringAssert.Contains(expected, actual);
        }

        public static void ShouldContainIgnoringCase(this string actual, string expected)
        {
            StringAssert.Contains(expected.ToLower(), actual.ToLower());
        }

        public static void ShouldNotContain(this string actual, string expected)
        {
            Assert.IsFalse(actual.Contains(expected), string.Format("'{0}' was found in '{1}'", expected, actual));
        }

        public static void ShouldEqual(this string actual, string expected)
        {
            Assert.AreEqual(expected, actual);
        }

        public static void ShouldEqualIgnoringCase(this string actual, string expected)
        {
            StringAssert.AreEqualIgnoringCase(expected, actual);
        }

        public static void ShouldBeEmpty(this string actual)
        {
            Assert.AreEqual(string.Empty, actual);
        }
    }
}